import time
import requests
from concurrent.futures.thread import ThreadPoolExecutor


pool = ThreadPoolExecutor(4, thread_name_prefix='HttpPoolExecutor-%d')


def http():
    a = time.time()
    resp = requests.get('http://www.baidu.com')
    b = time.time()
    print(resp.status_code, b - a)


for i in range(4):
    pool.submit(http)


while True:
    time.sleep(1)
